package medical.demo.controller;

import com.demo.pojo.THisDepartment;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import medical.demo.service.THisDepartmentService;

import javax.annotation.Resource;
import java.util.Collection;

@Controller
public class THisDepartmentController {

    @Resource
    private THisDepartmentService tHisDepartmentService;

    @GetMapping("/GetALLTHisDepartment/data")
    public Object GetALLTHisDepartment(Model model){
        Collection<THisDepartment> collection =tHisDepartmentService.GetAllTHisDepartment();
        model.addAttribute("lists",collection);
        return "registration/Department";
    }
}
